<?
include("../db.php");
include("auth.php");
include("top.php");
include("rollerinclude.php");
rollermeny();

if ($_REQUEST['process'] == 'true') {
	$tve=$_REQUEST['tve'];
	$neve=$_REQUEST['neve'];
	
	foreach ($tve as $id => $tall) {
		$sql="UPDATE r_Rolle SET nevekamptall=".$neve[$id].", tvekamptall=$tall WHERE ID=$id";
		mysql_query($sql);
	}
}

$sql="SELECT ID, rollekode, nevekamptall, tvekamptall FROM r_Rolle WHERE LaivID=$laivid ORDER BY rollekode";
$roller=mysql_query($sql);

?>
<h2>Roller - fix kamptall</h2>
<table border=1>
<form method="post" action="roller_fixkamptall.php">
<input type="hidden" name="process" value="true">
	<tr>
	<td>Navn</td>
	<td>Neve</td>
	<td>Tve</td>
	</tr>
<?


while ($rolle=mysql_fetch_assoc($roller)) {
	?>
	<tr>
	<td><?=$rolle['rollekode']?></td>
	<td><input name="neve[<?=$rolle['ID']?>]" size="3" value="<?=$rolle['nevekamptall']?>"></td>
	<td><input name="tve[<?=$rolle['ID']?>]" size="3" value="<?=$rolle['tvekamptall']?>"></td>
	</tr>
	<?
}

?>
</table>
<input type="submit" value="Oppdater base">
</form>
<?
include("bottom.php");
?>
